<template>
  <!-- 分页 -->
  <div class="demo-pagination-block">
    <el-pagination
      :current-page="currentPage"
      :page-size="pageSize"
      layout=" prev, pager, next"
      :total="total"
      @current-change="handleCurrentChange"
    />
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import type { ComponentSize } from 'element-plus'
const emit = defineEmits(['changeCur'])
// 分页
const props = defineProps({
  total: {
    type: Number,
    default: 10,
  },
  pageSize: {
    type: Number,
    default: 10,
  },
  currentPage: {
    type: Number,
    default: 10,
  },
})
console.log('props', props)
const handleCurrentChange = (val: number) => {
  console.log(`current page: ${val}`)
  emit('changeCur', val)
}
</script>

<style scoped>
.demo-pagination-block + .demo-pagination-block {
  margin-top: 10px;
}
.demo-pagination-block .demonstration {
  margin-bottom: 16px;
}
</style>
